/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2214 2215
 * @Package: PACKAGE_NAME
 * @File: ArraySum.java
 * @Time: 2022/12/13 11:41
 * @Author: abcque
 * @Description: 计算二维数组所有元素之和
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class ArraySum {
    public static void main(String[] args) {
        // 默认规定（惯例）：每行代表一个一维数组。
        int[][] arr = {{3,5,8},{12,9},{7,0,6,4}};

        int sum = 0;

        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                sum = sum + arr[i][j];
            }
        }

        System.out.println("所有元素之和 " + sum);
    }
}
